package util;
import java.io.File;

import org.hibernate.*;
import org.hibernate.cfg.*;
public class HibernateUtil {
	private static final SessionFactory sessionFactory;
	static{
		try{
			sessionFactory=new Configuration().configure(new File("hibernate.cfg.xml")).buildSessionFactory();
		}
		catch(Throwable ex){
			System.err.println("initial sessionfactory creation failed."+ex);
			throw new ExceptionInInitializerError(ex);
		}
	}
	public static SessionFactory getSessionFactory(){
		return sessionFactory;
	}
}
